1. Technical Field
The present disclosure relates to anti-aliasing techniques for computerized graphics, and particularly to a rendering method of an edge of a primitive.
2. Description of the Related Art
Computerized graphics is the technique of generating images on a hardware device, such as, for example, a display or screen, via computer. The generation of objects to be represented on a displaying device is commonly defined as rendering.
In computerized graphics, each object to be rendered is composed of a number of primitives.
A primitive is a simple geometric entity, such as, for example, a point, a line, a triangle, a rectangle, a polygon or a high-order surface.
The rendering of a primitive results to be quite critical as regards the rendering of each edge (edge or outline) of the same primitive, in which the need is strongly felt of minimizing a visual effect termed the aliasing effect.
As known, the aliasing effect consists in the so-called jagged or dashed effect of an edge of a primitive, which typically occurs when rendering an edge which results to be inclined relative to the vertical or horizontal edge of the displaying screen. In fact, a rendering method (simplest approach) consists in assigning no colors to the screen pixels which are not passed through by any edges, and in assigning the same color to all the screen pixels which are passed through by the same edge. This approach does not properly take into consideration the fact that a pixel can be partially covered by an edge (in the case where, for example, the pixel is passed through by the edge of the same primitive), and has as a consequence an abrupt color change between the primitive (therefore, the object) to be rendered on the scene and the background of the same scene, exactly due to the production of the aliasing effect.
Further approaches corresponding to as many rendering methods, with so-called anti-aliasing techniques, try to reduce (or shade) the aliasing effect by facing this problem.
Known rendering methods with anti-aliasing technique are, for example, the super-sampling method, or FSAA (Full Scenes Anti-Aliasing), and the multi-sampling method, or MSAA (Multi-Sampling Anti-Aliasing).
The FSAA method processes an image to a higher resolution, which is then scaled to the screen final resolution. For example, the 4×FSAA method performs a division of a screen pixel into four sub-pixels, and subsequently it checks how many of the four sub-pixels are covered by an edge of a primitive. According to the number of edge-covered sub-pixels, the method will assign a transparency coefficient to the original pixel, which corresponds to the cover percentage of the selected pixel from distinct coverage gradations referred to the number of sub-pixels belonging to the edge of the primitive (25% coverage, 1 covered sub-pixel; 50% coverage, 2 covered sub-pixels; 75% coverage, 3 covered sub-pixels; 100% coverage, 4 covered sub-pixels) and a non-coverage gradation (0%, not colored pixel). In this manner, it is possible to reduce the aliasing effect by introducing a shading effect of the so-called edge pixels by using a gray scale.
The MSAA method also, alternative to the method FSAA, processes an image to a higher resolution, which is subsequently scaled to the screen final resolution, except that it employs a single texture sample for each sub-pixel, thus reducing the required band compared to the FSAA method.
The above-mentioned rendering methods with anti-aliasing techniques are not free from drawbacks.
In fact, both the FSAA and MSAA methods require a processing of the image which is to be repeated as many times as the sampling sub-pixels are, and this leads to a drawback from a computational point of view. Furthermore, image processing in the FSAA method involves, for each sampling sub-pixel, reading a texture (image) from the memory, corresponding to a transparency coefficient, and the application of the texture to the relative single sub-pixel thus causing, in effect, a high and quite disadvantageous band occupancy.